package com.sun.service.impl;

import com.sun.mapper.FileUploadMapper;
import com.sun.pojo.FileUpload;
import com.sun.service.FileUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;


/**
 * @author Administrator
 */
@Service
@Transactional
public class FileUploadServiceImpl implements FileUploadService {

    @Autowired
    private FileUploadMapper fileUploadMapper;

    @Override
    public int saveFile(FileUpload fileUpload) {
        return fileUploadMapper.saveFile(fileUpload);
    }

    @Override
    public FileUpload findFileById(Integer id) {

        return fileUploadMapper.findFileById(id);
    }

    @Override
    public void updateFileDownCounts(Integer id, int downCounts) {
        fileUploadMapper.updateFileDownCounts(id,downCounts);
    }

    @Override
    public List<FileUpload> findAll(int id) {

        return fileUploadMapper.findAll(id);
    }

    @Override
    public int deleteFileById(Integer id) {

        return fileUploadMapper.deleteFileById(id);
    }
}
